package cn.apthink.calendar;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import cn.apthink.utility.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SpecialWorkDay {
	private String departmentId;
	private LocalDate workDate;
	private int startSecond;
	private int endSecond;
	private boolean overtime;
			
	public SpecialWorkDay(String departmentId, LocalDate workDate, String start, String end, boolean isOvertime) {
		this.departmentId = departmentId;
		this.workDate = workDate;
		this.startSecond = DateUtil.Time2Second(start);
		this.endSecond = DateUtil.Time2Second(end);
		this.overtime = isOvertime;
	}
	
	public SpecialWorkDay(String departmentId, LocalDate workDate, String start, String end) {
		this.departmentId = departmentId;
		this.workDate = workDate;
		this.startSecond = DateUtil.Time2Second(start);
		this.endSecond = DateUtil.Time2Second(end);
		this.overtime = false;
	}

	public static List<SpecialWorkDay> testDatas() {
		List<SpecialWorkDay> ws = new ArrayList<SpecialWorkDay>();
		ws.add(new SpecialWorkDay("factory", DateUtil.toDate("2025-02-27"), "08:00", "12:00"));
		ws.add(new SpecialWorkDay("factory", DateUtil.toDate("2025-02-27"), "13:00", "17:00"));
		ws.add(new SpecialWorkDay("floor", DateUtil.toDate("2025-02-28"), "08:00", "12:30"));
		ws.add(new SpecialWorkDay("floor", DateUtil.toDate("2025-02-28"), "13:00", "17:30"));
		ws.add(new SpecialWorkDay("l1", DateUtil.toDate("2025-03-01"), "08:00", "12:30"));
		ws.add(new SpecialWorkDay("l1", DateUtil.toDate("2025-03-01"), "13:00", "17:30"));
		return ws;
	}
}
